package Practice07;

import java.io.*;

public class test6 {

    public static void main(String[] args) {

        BufferedReader br = null;
        BufferedWriter bw = null;
        try {

            br = new BufferedReader(new FileReader("E:\\IDEAworks\\hdu_-java\\Practice\\src\\Practice07\\test6_1.txt"));
            bw = new BufferedWriter(new FileWriter("E:\\IDEAworks\\hdu_-java\\Practice\\src\\Practice07\\test6_2.txt"));

            String aLine;
            int i = 1;
            while ((aLine = br.readLine()) != null){
                System.out.println(aLine);
                bw.write("第"+i+"行"+aLine);
                bw.newLine();
                i++;
            }

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                bw.close();
                br.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
